package com.eicas.mapper;

import com.eicas.entity.User;
import com.eicas.entity.UserDB;
import org.springframework.stereotype.Component;

/**
 * @author: Administrator
 * @since: 2023/2/9 11:09
 * @description:
 */
@Component
public class UserMapperXML implements UserMapper{
    @Override
    public boolean validateUserInfo(User user) {
        boolean inDB = false;

        for (int i = 0; i < UserDB.userDB.size(); i++) {
            User dbUser = UserDB.userDB.get(i);
            if(user.getUsername().equals(dbUser.getUsername()) && user.getPassword().equals(dbUser.getPassword())){
                inDB = true;
            }
        }
        return inDB;
    }
}
